<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>开始</title>
</head>
<body>
  <form action="path/"></form>
  <input type="text" id="letter" placeholder="字母">
  -
  <input type="text" id="number" placeholder="数字">
  <input type="button" value="提交" onclick="inspect()">
  <script type="text/javascript">
    function inspect() {
      // 获取表单的action
      var action = document.forms[0].action;
      var letter = document.getElementById('letter');
      var number = document.getElementById('number');
      var nonNull1 = letter.value != null && letter.value != '';
      var nonNull2 = number.value != null && number.value != '';
      if (nonNull1 && nonNull2) {
        action = action + letter.value + '-' + number.value;
        window.location = action;
      }
    }
  </script>
</body>
</html>
